import { IContainer } from "./IContainer";
import { IPage } from "./IPage";
import { IWidget } from "./IWidget";
type ICmpnt = IContainerCmpnt | IPageCmpnt | IWidgetCmpnt;
interface IWidgetCmpnt extends IWidget {
    id: string;
    clone: () => IWidgetCmpnt;
}

interface IContainerCmpnt extends IContainer {
    id: string;
    clone: () => IContainerCmpnt;
}
interface IPageCmpnt extends IPage {
    id: string;
    clone: () => IPageCmpnt;
}
export const isWidget = (cmpt: any): cmpt is IWidgetCmpnt => {
    return cmpt.category === "widgets"
}
export const isContainer = (cmpt: any): cmpt is IContainerCmpnt => {
    return cmpt.category === "containers"
}
export const isPage = (cmpt: any): cmpt is IPageCmpnt => {
    return cmpt.category === "pages"
}
export const isBars = (cmpt: any): cmpt is IWidget => {
    return cmpt.category === "bars"
}
export const isPreset = (cmpt: any): cmpt is IWidget => {
    return cmpt.category === "presets"
}

export type { IWidgetCmpnt, IContainerCmpnt, IPageCmpnt, ICmpnt };